package com.example.demo.controller;

import com.example.demo.service.BlogService;
import com.example.demo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BlogController {

    @Autowired
    private BlogService blogService;

    /**
     * 文章列表
     * @param params
     * @return
     */
//    @PostMapping("/listBlog")
//    public Result listBlog(@RequestBody PageParams params){
//        return blogService.listBlog(params);
//    }




    @PostMapping("/blogDetail/{id}")
    public Result findBlogById(@PathVariable("id") int id){
        return blogService.findBlogById(id);
    }
}
